#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<string> findRelativeRanks(vector<int>& score) {
        int n = score.size();

        vector<pair<int, int>> need_sort;
        for (int i = 0; i < n; i++)
        {
            need_sort.push_back(make_pair(-score[i], i));
        }

        sort(need_sort.begin(), need_sort.end());

        vector<string> ret(n);
        for (int i = 0; i < n; i++)
        {
            int j = (need_sort[i]).second;
            if (i == 0) ret[j] = "Gold Medal";
            else if (i == 1) ret[j] = "Silver Medal";
            else if (i == 2) ret[j] = "Bronze Medal";
            else ret[j] = to_string(i + 1);
        }
        return ret;
    }
};